﻿<telerik:RadWindow x:Class="Rio.Framework.Pages.MessageBoxChildWindow"
                   Name="messageBoxChildWindow"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                   xmlns:controls="clr-namespace:Rio.Framework.Pages.Controls"
                   mc:Ignorable="d"
                   Header="{Binding Title, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                   MaxWidth="600"
                   MinWidth="400"
                   MinHeight="150"
                   MaxHeight="400"
                   DialogResult="False"
                   CanClose="False"
                   WindowStartupLocation="CenterScreen">

    <telerik:RadWindow.Resources>
        <LinearGradientBrush x:Key="DefaultModalBackground"
                             EndPoint="0.5,1"
                             StartPoint="0.5,0">
            <GradientStop Color="#E5000000" />
            <GradientStop Color="#4C000000"
                          Offset="0.5" />
            <GradientStop Color="#E5000000"
                          Offset="1" />
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="InfoModalBackground"
                             EndPoint="0.5,1"
                             StartPoint="0.5,0">
            <GradientStop Color="#E5000118" />
            <GradientStop Color="#4C000000"
                          Offset="0.5" />
            <GradientStop Color="#E5000118"
                          Offset="1" />
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="ErrorModalBackground"
                             EndPoint="0.5,1"
                             StartPoint="0.5,0">
            <GradientStop Color="#E5180000" />
            <GradientStop Color="#4C000000"
                          Offset="0.5" />
            <GradientStop Color="#E5180000"
                          Offset="1" />
        </LinearGradientBrush>
        <LinearGradientBrush x:Key="WarningModalBackground"
                             EndPoint="0.5,1"
                             StartPoint="0.5,0">
            <GradientStop Color="#E5171800" />
            <GradientStop Color="#4C000000"
                          Offset="0.5" />
            <GradientStop Color="#E5171800"
                          Offset="1" />
        </LinearGradientBrush>
    </telerik:RadWindow.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Image Name="msgIcon"
               Stretch="Fill"
               Source="/Rio.Framework.Pages;component/Assets/Images/MessageBox/info.png"
               MaxWidth="40"
               MaxHeight="40"
               Margin="10,0"
               VerticalAlignment="Center"
               HorizontalAlignment="Center" />
        <StackPanel Grid.Column="1"
                    Margin="5"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center">
                <TextBlock TextWrapping="Wrap"
                           FontWeight="Bold"
                           FontStyle="Italic"
                           TextTrimming="WordEllipsis"
                           HorizontalAlignment="Left"
                           Text="{Binding Message, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                           VerticalAlignment="Center" />
                <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto"
                              BorderThickness="0"
                              HorizontalAlignment="Left"
                              VerticalAlignment="Center">
                    <TextBlock TextWrapping="Wrap"
                               Text="{Binding MessageDetail, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                               TextTrimming="WordEllipsis"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Center" />
                </ScrollViewer>
            </StackPanel>

        <StackPanel Grid.Row="1"
                    Orientation="Horizontal"
                    Grid.ColumnSpan="2"
                    HorizontalAlignment="Right"
                    Margin="0,0,0,5">
            <telerik:RadButton Name="okButton"
                               Content="OK"
                               Margin="5,0"
                               Command="{Binding ButtonClickCommand, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                               CommandParameter="ok"
                               Width="50" />
            <telerik:RadButton Name="yesButton"
                               Content="Yes"
                               Margin="5,0"
                               Command="{Binding ButtonClickCommand, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                               CommandParameter="yes"
                               Width="50" />
            <telerik:RadButton Name="cancelButton"
                               Content="Cancel"
                               Margin="5,0"
                               Command="{Binding ButtonClickCommand, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                               CommandParameter="cancel"
                               Width="50" />
            <telerik:RadButton Name="noButton"
                               Content="No"
                               Margin="5,0"
                               Command="{Binding ButtonClickCommand, ElementName=messageBoxChildWindow, Mode=TwoWay}"
                               CommandParameter="no"
                               Width="50" />
        </StackPanel>
    </Grid>

</telerik:RadWindow>